/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vn.com.sml.SEFM.model;

import java.util.List;
import org.apache.poi.hssf.usermodel.HSSFCell;
import vn.com.sml.SEFM.domain.Transactions;

/**
 *
 * @author Tunp
 */
public class TransactionForVerify {
    private Transactions trans;
    private String buyer_name;
    private String receiver_name;

    public TransactionForVerify(Transactions trans, String buyer_name, String receiver_name) {
        this.trans = trans;
        this.buyer_name = buyer_name;
        this.receiver_name = receiver_name;
    }

    public String getReceiver_name() {
        return receiver_name;
    }

    public void setReceiver_name(String receiver_name) {
        this.receiver_name = receiver_name;
    }

    public String getBuyer_name() {
        return buyer_name;
    }

    public void setBuyer_name(String buyer_name) {
        this.buyer_name = buyer_name;
    }

    public Transactions getTrans() {
        return trans;
    }

    public void setTrans(Transactions trans) {
        this.trans = trans;
    }
    
    public TransactionForVerify(String filename) throws Exception {
        ReadFile rd = new ReadFile();
        List sheetData = rd.Read(filename);
        
        Transactions trans = new Transactions()
        for (int i = 0; i < sheetData.size(); i++) {
            List list = (List) sheetData.get(i);
            for (int j = 0; j < list.size(); j++) {
                HSSFCell cell = (HSSFCell) list.get(j);
                System.out.print(cell.getRichStringCellValue().getString());
                if (j < list.size() - 1) {
                    System.out.print(", ");
                }
            }
            System.out.println("");
        }
    }
}
